package jp.ddo.trismegistos.timer.activity;

import jp.ddo.trismegistos.timer.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

/**
 * 
 * @author y_sugasawa
 * @author $Author: aigis.developer@gmail.com $
 * @version $Rev: 41 $ $Date: 2011-09-26 15:42:24 +0000 (Mon, 26 Sep 2011) $
 * 
 */
public class TopActivity extends Activity implements OnClickListener {

	private Button stopwatchButton;

	private Button timerButton;

	@Override
	public void onCreate(final Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		stopwatchButton = (Button) findViewById(R.id.stopwatch);
		stopwatchButton.setOnClickListener(this);

		timerButton = (Button) findViewById(R.id.timer);
		timerButton.setOnClickListener(this);
		
		hoge();
	}

	protected int hoge() {
		return 1;
	}
	
	/**
	 * {@inheritDoc}
	 */
	@Override
	public void onClick(final View v) {
		final Button button = (Button) v;

		Intent intent = null;
		switch (button.getId()) {
		case (R.id.stopwatch):
			intent = new Intent(TopActivity.this, Stopwatch.class);
			startActivity(intent);
			break;
		case (R.id.timer):
			intent = new Intent(TopActivity.this, TimerActivity.class);
			startActivity(intent);
			break;
		default:
			break;
		}
	}

}